import java.util.Scanner;

public class P1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n1 = scanner.nextInt();
        int n2 = scanner.nextInt();
        int previousPrime = -1;
        for (int i = n1; i < n2-2; i++) {
            if (isPrime(i) && isPrime(i+2)){
                if (i != previousPrime) {
                    System.out.println(i +" "+(i+2));
                    previousPrime = i+2;
                }
            }
        }
    }

    public static boolean isPrime(int i){
        if (i <= 1){
            return false;
        }
        for (int j = 2; j <= Math.sqrt(i); j++) {
            if (i % j == 0){
                return false;
            }
        }
        return true;
    }

}
